package com.atguigu.lease.common.context;

/**
 * @Author: shenhao
 * @CreatTime: 2024/9/10 14:49
 * @Version: 1.0
 */
public class LoginUserContext {
    private static final ThreadLocal<LoginUser> userThreadLocal = new ThreadLocal<>();

    public static LoginUser getUser() {
        return userThreadLocal.get();
    }
    public static void setUser(LoginUser user) {
        userThreadLocal.set(user);
    }
    public static void removeUser() {
        userThreadLocal.remove();
    }
}
